var MyPlugin = {
    _GetSearchString: function (name) {
        var returnValue = "";
        var key = Pointer_stringify(name);
        var url = location.search.replace(/^\?/, '').split('&');
        var paramsObj = {};
        for (var i = 0, iLen = url.length; i < iLen; i++) {
            var param = url[i].split('=');
            paramsObj[param[0]] = param[1];
        }
        if (paramsObj[key]) {
            returnValue = paramsObj[key];
        }
        var buffer = _malloc(lengthBytesUTF8(returnValue) + 1);
        writeStringToMemory(returnValue, buffer);
        return buffer;
    },
    _SetName: function (name) {
        var msg = Pointer_stringify(name);
        document.getElementById("username").innerHTML = msg;
        updateUsername();
    }
};

mergeInto(LibraryManager.library, MyPlugin);
